package com.ruoyi.other.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.other.mapper.EBulletinMapper;
import com.ruoyi.other.domain.EBulletin;
import com.ruoyi.other.service.IEBulletinService;

/**
 * 广播公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class EBulletinServiceImpl implements IEBulletinService 
{
    @Autowired
    private EBulletinMapper eBulletinMapper;

    /**
     * 查询广播公告
     * 
     * @param id 广播公告主键
     * @return 广播公告
     */
    @Override
    public EBulletin selectEBulletinById(Long id)
    {
        return eBulletinMapper.selectEBulletinById(id);
    }

    /**
     * 查询广播公告列表
     * 
     * @param eBulletin 广播公告
     * @return 广播公告
     */
    @Override
    public List<EBulletin> selectEBulletinList(EBulletin eBulletin)
    {
        return eBulletinMapper.selectEBulletinList(eBulletin);
    }

    /**
     * 新增广播公告
     * 
     * @param eBulletin 广播公告
     * @return 结果
     */
    @Override
    public int insertEBulletin(EBulletin eBulletin)
    {
        return eBulletinMapper.insertEBulletin(eBulletin);
    }


    /**
     * 批量删除广播公告
     * 
     * @param ids 需要删除的广播公告主键
     * @return 结果
     */
    @Override
    public int deleteEBulletinByIds(Long[] ids)
    {
        return eBulletinMapper.deleteEBulletinByIds(ids);
    }

    /**
     * 删除广播公告信息
     * 
     * @param id 广播公告主键
     * @return 结果
     */
    @Override
    public int deleteEBulletinById(Long id)
    {
        return eBulletinMapper.deleteEBulletinById(id);
    }

    @Override
    public int updateByid(EBulletin eBulletin) {
        if(eBulletin.getStatus()==1){
            return eBulletinMapper.updateStatusxia(eBulletin.getId());
        }else{
            return eBulletinMapper.updateStatusShang(eBulletin.getId());
        }

    }

}
